/*
 *  Copyright (c) 2023-2025 苏州棱镜七彩信息科技有限公司 (Suzhou PrismAurora Information Technology Co.,Ltd)
 *  sbom-generate is licensed under Mulan PSL v2.
 *  You can use this software according to the terms and conditions of the Mulan PSL v2.
 *  You may obtain a copy of Mulan PSL v2 at:
 *           http://license.coscl.org.cn/MulanPSL2
 *  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 *  See the Mulan PSL v2 for more details.
 * */
package com.ljqc.entity.command;

import com.ljqc.entity.Command;

import java.io.File;

/**
 * @ClassName Command
 * @Description
 * @Date 2022/8/11 11:05
 * @Version V1.0
 **/
public class MavenCommand extends Command {


    public static MavenCommand create() {
        return new MavenCommand();
    }

    public MavenCommand cd(String path) {
        super.cd(path);
        return this;
    }


    public MavenCommand mvn() {
        appendPrefix();
        String mvn = ENVIRONMENT_VARIABLE_MAP.get("mvn");
        if (mvn != null) {
            sb.append(mvn.endsWith(File.separator) ? mvn : mvn + File.separator);
        }
        sb.append("mvn").append(" ");
        return this;
    }


    public MavenCommand dependency(String type) {
        sb.append("dependency:").append(type).append(" ");
        return this;
    }

    public MavenCommand outputAbsoluteArtifactFilename(boolean type) {
        sb.append("-DoutputAbsoluteArtifactFilename=").append(type).append(" ");
        return this;
    }

    public MavenCommand tn(int num) {
        sb.append("-T").append(num).append(" ");
        return this;
    }

    public MavenCommand outPutFile(String path) {
        sb.append("-DoutputFile=\"").append(path).append("\" ");
        return this;
    }


}
